#ifdef _SYMBIAN_SDK_
/*
 ============================================================================
 Name		: newsymAppView.cpp
 Author	  : 
 Copyright   : Your copyright notice
 Description : Application view implementation
 ============================================================================
 */

// INCLUDE FILES
#include  <aknviewappui.h>
#include  <avkon.hrh>
#include "skyAppView.h"
#include "skyFrameWork.h"
// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CnewsymAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//

CskyAppView* CskyAppView::NewL()
{
	CskyAppView* self = new (ELeave) CskyAppView();

	CleanupStack::PushL( self );
	self->ConstructL();
	CleanupStack::Pop();
	return self;
}
// ---------------------------------------------------------
// CTestExView::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CskyAppView::ConstructL()
{
    iframeWork = NULL;
	BaseConstructL(0);
}

// ---------------------------------------------------------
// CTestExView::~CTestExView()
// destructor
// ---------------------------------------------------------
//
CskyAppView::~CskyAppView()
{
	if (iframeWork)
	{

		AppUi()->RemoveFromViewStack( *this, iframeWork);
	}
}

// ---------------------------------------------------------
// TUid CTestExView::Id()
//
// ---------------------------------------------------------
//
TUid CskyAppView::Id() const
{
	return KQQVIEWId;
}

// ---------------------------------------------------------
// CTestExView::HandleCommandL(TInt aCommand)
// takes care of view command handling
// ---------------------------------------------------------
//
void CskyAppView::HandleCommandL(::TInt aCommand)
{
	switch (aCommand)
	{
	case EAknSoftkeyOk:
		{
			break;
		}
	case EAknSoftkeyBack:
		{
			AppUi()->HandleCommandL(EEikCmdExit);
			break;
		}
	default:
		{
			AppUi()->HandleCommandL(aCommand);
			break;
		}
	}
}

TUid CskyAppView::GetCurrentFepUid() const
{
#ifdef __SERIES60_3X__
	return iEikonEnv->FepUid();
#else
	TUid fepID = TUid::Uid(0);
	return fepID;
#endif
}

// ---------------------------------------------------------
// CTestExView::HandleClientRectChange()
// ---------------------------------------------------------
//
void CskyAppView::HandleClientRectChange()
{
	if (iframeWork)
	{
		iframeWork->SetRect(ClientRect() );
	}
}

// ---------------------------------------------------------
// CTestExView::DoActivateL(...)
// 
// ---------------------------------------------------------
//
void CskyAppView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
						  TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
{
	if(iframeWork)
	{
		AppUi()->AddToViewStackL(*this, iframeWork);

	}
}

// ---------------------------------------------------------
// CTestExView::DoDeactivate()
// 
// ---------------------------------------------------------
//
void CskyAppView::DoDeactivate()
{
	if (iframeWork)
	{
		::TRect rtFull = iframeWork->Rect();
		rtFull.Move(0, 150);
		iframeWork->SetRect(rtFull);

		AppUi()->RemoveFromViewStack( *this, iframeWork);
	}
}

EXPORT_C void CskyAppView::SetFrameWork(skyFrameWork* aQQContainer)
{
	iframeWork = aQQContainer;
}

EXPORT_C skyFrameWork* CskyAppView::GetFrameWork( )
{
	return iframeWork;
}
// End of File

#endif